using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BUS;
using Utility;
using ENTITIES;

public partial class admin_SuaKhachHang : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btn_sua_Click(object sender, EventArgs e)
    {
        try
        {
            int id = int.Parse(Request.QueryString["iD"].ToString());
            TBKhachHang khachhang = KhachHangBUS.GetByID(id);

            khachhang.tenkh = txt_TenKH.Text;
            khachhang.taikhoan = txt_TaiKhoan.Text;
            khachhang.matkhau = txt_MatKhau.Text;
            khachhang.sodt = txt_SoDT.Text;            
            khachhang.email = txt_Email.Text;
            khachhang.diachi = txt_DiaChi.Text;

            KhachHangBUS.Update(khachhang);
        }
        catch (Exception ex)
        {
        }
        Response.Redirect("~/admin/DanhSachKhachHang.aspx");
        Response.Redirect(Request.RawUrl);
    }
}
